/**
 *Copyright (c) 2024 watereyes
 * workflow is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.workflow.systemManag.service;

import com.koron.workflow.systemManag.bean.EnumItemBean;
import com.koron.workflow.systemManag.bean.EnumQueryBean;
import com.koron.workflow.common.bean.PageBean;
import com.koron.workflow.common.bean.StaffBean;
import org.koron.ebs.mybatis.SessionFactory;
import org.swan.bean.MessageBean;

import java.util.List;
import java.util.Map;

/**
 * 数据字典
 */
public interface EnumService {
    /**
     * 根据条件查询 数据字典 列表
     * @param factory
     * @param code 字典组编号
     * @param name 字典组名称
     * @param page
     * @param pageSize
     * @return
     */
    PageBean queryForList(SessionFactory factory, String code, String name, Integer page, Integer pageSize);

    /**
     * 根据字典组编号查询数据字典
     * @param factory
     * @param code
     * @return
     */
    EnumQueryBean queryForObject(SessionFactory factory, String code);

    /**
     * 保存数据字典
     * @param user
     * @param bean
     * @return
     */
    MessageBean save(SessionFactory factory, StaffBean user, EnumQueryBean bean);

    /**
     * 修改数据字典
     * @param user
     * @param oldCode 历史字典组编号
     * @param bean
     * @return
     */
    MessageBean update(SessionFactory factory, StaffBean user, String oldCode, EnumQueryBean bean);

    /**
     * 删除数据字典
     * @param code
     * @return
     */
    MessageBean delete(SessionFactory factory, String code);

    /**
     * 根据字典组编号查询字典
     * @param code 字典组编号
     * @param filterKeys 要过滤的字典key,多个以逗号分隔
     * @return
     */
    List<Map> querySelectByCode(SessionFactory factory, String code , String filterKeys);

    /**
     * 获取所有数据字典信息
     * @param factory
     * @return
     */
    List<Map> queryAllEnum(SessionFactory factory);
}
